import java.util.Scanner;
import static java.lang.Math.sqrt;

public class practice {
    //打印x型图案
    public static void main7(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            for(int i = 0;i < n;i++){
                for(int j = 0;j < n;j++){
                    if(i == j||i+j==n-1){
                        System.out.print("*");
                    }else{
                        System.out.print(" ");
                    }

                }
                System.out.println();
            }
        }
    }
    //求最大公约数
    public static void main(String[] args) {
        System.out.println("请输入两个数");
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if(a < b){
            int tmp = a;
            a = b;
            b = tmp;
        }
        int ch = 0;
        //辗转相除法求最大公约数
        while ( a % b!=0){
            ch = a % b;
            a = b;
            b =ch;
        }
        System.out.println("最大公约数是"+b);
    }
    public static void main5(String[] args) {
        System.out.println("请输入一个数字");
        Scanner sn = new Scanner(System.in);
        int n = sn.nextInt();
        int count = 0;
        //用移位操作符来求整数二进制中1的个数
        for(int i = 0;i < 32;i++){
            if(((n>>i)&1)==1){
                count++;
            }
        }
        System.out.println(n+"的二进制中1的个数为"+count+"个");
    }
    public static void main4(String[] args) {
        System.out.println("请输入一个数字");
        Scanner ch= new Scanner(System.in);
        int n=ch.nextInt();
        int i = 0;
        for(i = 2;i < sqrt(n);i++){
            if(n%i==0){
                break;
            }
        }
        if(i > sqrt(n)) {
            System.out.println(n + "是素数");
        }else{
            System.out.println(n + "不是素数");
        }

    }
    public static void main3(String[] args) {
        int i = 0;
        for(i = 1000;i <= 2000;i++){
            if(i % 400 == 0||(i % 100 != 0)&&(i % 4 == 0)){
                System.out.printf(i+" ");
            }
        }
    }
    public static void main2(String[] args) {
        int i = 0;
        int count = 0;
        for(i=0;i<100;i++){
            if(i%10 == 9){
                count++;
            }
            if (i/10 == 9|| i%100==9){
                count++;
            }
        }
        System.out.println(count);

    }
    public static void main1(String[] args) {
        int i = 0;
        int j = 0;
        for (i = 2;i < 100; i++){
            for(j = 2;j <= sqrt(i); j++){
                if(i%j == 0) {
                    break;
                }
            }
            if(j > sqrt(i)) {
                System.out.print(i + " ");
            }
        }
    }
}
